package designprinciples.demeter.positive;

/**
 * @program: MyTank
 * @description:
 * @author: 王术平
 * @create: 2021-01-24 15:09
 **/
public class Person {
    public static void main(String[] args) {
        Restaurant re = new Restaurant();
//        re.greenPepperMeat();
//        re.tomatoAndEggSoup();
        re.setMeal01();
        re.setMeal02();
    }
}


//饭店
class Restaurant {
    //青椒肉丝。
    private void greenPepperMeat() {
        System.out.println("青椒肉丝上菜了");
    }

    private void potatoSilk() {
        System.out.println("土豆丝上菜了");
    }

    //番茄蛋汤
    private void tomatoAndEggSoup() {
        System.out.println("番茄蛋汤上菜了");
    }


    public void setMeal01() {
        this.greenPepperMeat();
        this.tomatoAndEggSoup();
    }

    public void setMeal02() {
        this.potatoSilk();
        this.tomatoAndEggSoup();
    }
}
